//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { UserHasRoles, UserHasRolesResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooUserHasRolesList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<UserHasRolesResponse>(`/uctoo/user_has_roles/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooUserHasRoles = async (id: string) => {
  return requestClient.get<UserHasRoles>(`/uctoo/user_has_roles/${id}`);
};

export const adductooUserHasRoles = async (data: Partial<UserHasRoles>) => {
  return requestClient.post<UserHasRoles>('/uctoo/user_has_roles/add', data);
};

export const edituctooUserHasRoles = async (data: Partial<UserHasRoles>) => {
  return requestClient.post<UserHasRoles>('/uctoo/user_has_roles/edit', data);
};

export const deleteuctooUserHasRoles = async (id: string) => {
  return requestClient.post<any>('/uctoo/user_has_roles/del', { id });
};
